"use strict";
cc._RF.push(module, '454e4iAK9ZKkJSRzRBlR1d1', 'HomeCaseBtn');
// scripts/home/HomeCaseBtn.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var CaseManager_1 = require("../common/CaseManager");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var HomeCaseBtn = /** @class */ (function (_super) {
    __extends(HomeCaseBtn, _super);
    function HomeCaseBtn() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.nameLabel = null;
        _this.caseName = null;
        return _this;
    }
    HomeCaseBtn.prototype.onLoad = function () {
        this.init();
        this.registerEvent();
    };
    HomeCaseBtn.prototype.start = function () {
        this.reset();
    };
    HomeCaseBtn.prototype.onDestroy = function () {
        this.unregisterEvent();
    };
    /**
     * 订阅事件
     */
    HomeCaseBtn.prototype.registerEvent = function () {
        this.node.on(cc.Node.EventType.TOUCH_END, this.onClick, this);
    };
    /**
     * 取消事件订阅
     */
    HomeCaseBtn.prototype.unregisterEvent = function () {
        this.node.off(cc.Node.EventType.TOUCH_END, this.onClick, this);
    };
    /**
     * 初始化
     */
    HomeCaseBtn.prototype.init = function () {
    };
    /**
     * 重置
     */
    HomeCaseBtn.prototype.reset = function () {
    };
    /**
     * 点击
     */
    HomeCaseBtn.prototype.onClick = function () {
        CaseManager_1.default.goCase(this.caseName);
    };
    /**
     * 设置
     * @param caseName
     * @param info
     */
    HomeCaseBtn.prototype.set = function (caseName, info) {
        this.caseName = caseName;
        this.nameLabel.string = info.name;
    };
    __decorate([
        property(cc.Label)
    ], HomeCaseBtn.prototype, "nameLabel", void 0);
    HomeCaseBtn = __decorate([
        ccclass
    ], HomeCaseBtn);
    return HomeCaseBtn;
}(cc.Component));
exports.default = HomeCaseBtn;

cc._RF.pop();